package com.ruoyi.project.common;

import com.ruoyi.framework.redis.RedisCache;
import com.ruoyi.framework.web.domain.AjaxResult;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

/**
 * @ProjectName: ReportQuery
 * @Package: com.ruoyi.project.common
 * @ClassName: GenCodeController
 * @Description: 序列号生成
 * @Author: Zhujj
 * @CreateDate: 2020/01/19 11:32
 * @Version: 1.0
 */
@RestController
public class GenCodeController {

    @Autowired
    private RedisCache redisCache;
    /**
     * 通用上传请求
     */
    @GetMapping("/common/genCode/{key}")
    public AjaxResult uploadFile(@PathVariable(value = "key", required = true) String key)
    {
        return AjaxResult.success("获取编码成功",redisCache.generate(key));
    }
}
